package net.kesumu.yushabuserver;

import javax.websocket.Session;

public class ClientSession {

    private int userId;
    
    private Session messageSession;
    private Session notificatioinSession;
    private String umengDeviceToken;
    
    public ClientSession() {
        userId = 0;
        messageSession = null;
        notificatioinSession = null;
    }
    
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("ClientSession: {umengDeviceToken: ");
        sb.append(umengDeviceToken);
        sb.append("}");
        return sb.toString();
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public Session getMessageSession() {
        return messageSession;
    }

    public void setMessageSession(Session messageSession) {
        this.messageSession = messageSession;
    }

    public Session getNotificatioinSession() {
        return notificatioinSession;
    }

    public void setNotificatioinSession(Session notificatioinSession) {
        this.notificatioinSession = notificatioinSession;
    }
    
    public boolean isMessageSessionOnline() {
        if(messageSession == null) {
            return false;
        }
        return true;
    }
    public boolean isNotificationSessionOnline() {
        if(notificatioinSession == null) {
            return false;
        }
        return true;
    }

    public String getUmengDeviceToken() {
        return umengDeviceToken;
    }

    public void setUmengDeviceToken(String umengDeviceToken) {
        this.umengDeviceToken = umengDeviceToken;
    }
    
}
